import fs from "fs";
import path from "path";
import yaml from "yaml";

const yamlText = fs.readFileSync(
  path.join(process.cwd(), "./openapi.yaml"),
  "utf8"
);
const json = yaml.parse(yamlText);
fs.writeFileSync(
  path.join(process.cwd(), "./openapi.json"),
  JSON.stringify(json, null, 2)
);
